package pro.lepers.portfolio.view.contents.contact {
	import fr.digitas.flowearth.ui.layout.Layout;
	import fr.digitas.flowearth.ui.layout.renderer.TopRenderer;

	import flash.display.Sprite;
	import flash.geom.Rectangle;

	/**
	 * @author plepers
	 */
	public class ItemList extends Sprite {
		public function ItemList ( list : XML ) {
			buildLayout();
			buildItems( list );
		}

		private function buildItems (list : XML) : void {
			
			var xmll : XMLList = list.item;
			var item : Item;
			for each (var  id : XML in xmll ) {
				
				item = new ContactItem_FC();
				item.value.text = id.value.text();
				item.nameMc.lbl.text = id.name.text();
				
				_layout.addChild( item );
			}
		}

		
		private function buildLayout() : void {
			_layout = new Layout( );
			_layout.renderer = new TopRenderer( );
			_layout.margin = new Rectangle();
			addChild( _layout );
		}
		
		private var _layout : Layout;
	}
}
